package android.slc.module.project.repository.local;

import android.slc.box.db.sp.DpManager;

public class ProjectConfig extends DpManager {
    private static class Holder {
        private static final ProjectConfig INSTANCE = new ProjectConfig();
    }

    public static ProjectConfig getInstance() {
        return Holder.INSTANCE;
    }

    protected ProjectConfig() {
        super("project_config");
        dp.putIfAbsent("openMock", false, false)
                .putIfAbsent("mockPeriod", 4000, false)
                .putIfAbsent("autoRestart", true, false)
                .putIfAbsent("forcedDebug", false, false)
                .putIfAbsent("goToHomeMinute", 30, false)
                .putIfAbsent("browserViewFull", false, false)
                .putIfAbsent("browserUrl", "https://cn.bing.com/");
    }

    public boolean isOpenMock() {
        return dp.getBoolean("openMock", false, true);
    }

    public int getMockPeriod() {
        return dp.getInt("mockPeriod", 4000, true);
    }

    public boolean isAutoRestart() {
        return dp.getBoolean("autoRestart", true, true);
    }

    public boolean isForcedDebug() {
        return dp.getBoolean("forcedDebug", false, true);
    }

    public int getGoT0HomeMinute() {
        return dp.getInt("goToHomeMinute", 30, true);
    }

    public boolean getBrowserViewFull() {
        return dp.getBoolean("browserViewFull", false, true);
    }

    public void setBrowserViewFull(boolean browserViewFull) {
        dp.putValue("browserViewFull", browserViewFull);
    }

    public String getBrowserUrl() {
        return dp.getString("browserUrl", "https://cn.bing.com/", true);
    }
}
